package com.nk.iexam;

import java.util.List;

import com.nk.iexam.adapter.ReviewAdapter;
import com.nk.iexam.ds.TheoryReviewDataSource;
import com.nk.iexam.models.Category;
import com.nk.iexam.models.TheoryReview;

import android.os.Bundle;
import android.app.ListActivity;

public class QAActivity extends ListActivity
{
	private List<TheoryReview> _theoryQAs;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_qa);
        Category category = (Category) getIntent().getSerializableExtra(ReviewActivity.CATEGORY);
        
        TheoryReviewDataSource dataSource = new TheoryReviewDataSource();
        _theoryQAs = dataSource.selectObjects(TheoryReviewDataSource.CATEGORY_ID + " = " + category.getId());
        getListView().setAdapter(new ReviewAdapter(this, R.layout.category_list_row, _theoryQAs));
    }
}
